<?php
/**
 * Created by PhpStorm.
 * User: yuanluke
 * Date: 4/25/16
 * Time: 12:10
 */

namespace App\Http\Utils\Common;

class OperResult {

    const CODE_CREATE_OK = 1;
    const CODE_READ_OK = 2;
    const CODE_UPDATE_OK = 3;
    const CODE_DELETE_OK = 4;

    const CODE_CREATE_OK_DESC = '创建成功';
    const CODE_DELETE_OK_DESC = '删除成功';
    const CODE_UPDATE_OK_DESC = '更新成功';
    const CODE_READ_OK_DESC = '读取成功';

    const CODE_500 = 500;
    const CODE_500_DESC = '服务器异常';
    const CODE_501 = 501;
    const CODE_501_DESC = '无权限';

    const CODE_CREATE_FAIL = -1;
    const CODE_DELETE_FAIL = -2;
    const CODE_UPDATE_FAIL = -3;
    const CODE_READ_FAIL = -4;
    const CODE_CREATE_FAIL_DESC = '创建失败';
    const CODE_DELETE_FAIL_DESC = '删除失败';
    const CODE_UPDATE_FAIL_DESC = '更新失败';
    const CODE_READ_FAIL_DESC = '读取失败';

    const CODE_NICK_EXIST = -5;
    const CODE_NICK_EXIST_DESC = '昵称重复';


    const CODE_FORM_VALIDATE_FAIL = -6;
    const CODE_FORM_VALIDATE_FAIL_DESC = '表单验证失败';

    const CODE_AUTH_FAIL = -7;
    const CODE_AUTH_FAIL_DESC = '登录失败';
	const CODE_AUTH_OK = 7;
	const CODE_AUTH_OK_DESC = '登录成功';
    const CODE_AUTH_EXPIRED = -12;
    const CODE_AUTH_EXPIRED_DESC = '账号过期';
    const CODE_AUTH_FAIL_VCODE = -13;
    const CODE_AUTH_FAIL_VCODE_DESC = '验证码错误';
    const CODE_CSRF_EXPIRED = -14;
    const CODE_CSRF_EXPIRED_DESC = '过期';
    const CODE_PARAM_MISSING = -15;
    const CODE_PARAM_MISSING_DESC = '缺少参数';

    const CODE_UPLOAD_IMG_EXT_FAIL = -8;
    const CODE_UPLOAD_IMG_EXT_FAIL_DESC = '图片仅支持png, jpg, jpeg, gif等格式';
    const CODE_UPLOAD_FILE_SIZE_FAIL = -9;
    const UPLOAD_IMG_MAX_SIZE = 600;
    const UPLOAD_FILE_MAX_SIZE = 10;
    const CODE_UPLOAD_FILE_SIZE_FAIL_DESC = '上传文件超过'.self::UPLOAD_FILE_MAX_SIZE.'mb限制大小';
    const CODE_UPLOAD_IMG_SIZE_FAIL_DESC = '上传图片超过'.self::UPLOAD_IMG_MAX_SIZE.'kb限制大小';
	const CODE_UPLOAD_FAIL = -10;
	const CODE_UPLOAD_FAIL_DESC = '上传文件异常';
    const CODE_UPLOAD_MUSIC_EXT_FAIL = -11;
    const CODE_UPLOAD_MUSIC_EXT_FAIL_DESC = '音频仅支持mp3, mp4, mid, wav, wma, rm等格式';


    const CODE_ACTIVATE_OK = 16;
    const CODE_ACTIVATE_OK_DESC = '激活成功';
    const CODE_ACTIVATE_EXPIRE = -16;
    const CODE_ACTIVATE_EXPIRE_DESC = '激活链接已经过期';
    const CODE_USER_NOT_EXIST = -17;
    const CODE_USER_NOT_EXIST_DESC = '用户不存在';
    const CODE_ALREADY_ACTIVATE = -18;
    const CODE_ALREADY_ACTIVATE_DESC = '用户已经激活';
    const CODE_USER_SEALED = -19;
    const CODE_USER_SEALED_DESC = '用户已经被封号';
    const CODE_ACTIVATE_NOT_EXPIRE = -21;
    const CODE_ACTIVATE_NOT_EXPIRE_DESC = '用户还在有效激活期';


    const CODE_SEND_MAIL_OK = 20;
    const CODE_SEND_MAIL_OK_DESC = '邮件发送成功';
    const CODE_SEND_MAIL_FAIL = -20;
    const CODE_SEND_MAIL_FAIL_DESC = '邮件发送失败';

    const CODE_LOGIN_FAIL = -25;
    const CODE_LOGIN_DESC = '请登录';

    const CODE_NOT_PERM_FAIL = -26;
    const CODE_NOT_PERM_DESC = '权限不足';

}